ig.module(
	'game.entities.linkButton'
)
.requires(
	'impact.entity',
        'game.entities.base.baseButton'
)
.defines(function()
{
    EntityLinkButton = EntityBaseButton.extend(
    {
        normalButton: new ig.Image("media/images/finish.png"),
        overButton: new ig.Image("media/images/finishOver.png"),
	
	init: function(x, y, settings)
	{
	    this.parent(x, y, settings);	    
	},
	
        onClick: function()
        {
            this.parent();
            
            var url = ig.global.fullQuestion[ig.global.currentQuestion].link;
            url = url.replace("#", "");
            url = url.replace("#", "");
            alert(url);
            var windowName = "popUp";

	    var wOpen;
	    var sOptions;
	    
	    sOptions = 'status=yes,menubar=yes,scrollbars=no,resizable=yes,toolbar=yes';
	    sOptions = sOptions + ',width=' + (screen.availWidth - 8).toString();
	    sOptions = sOptions + ',height=' + (screen.availHeight - 122).toString();
	    sOptions = sOptions + ',screenX=0,screenY=0,left=0,top=0,maximized=true';	
	    
	    wOpen = window.open('', 'Material Complementar', sOptions);
	    wOpen.location = url;
	    wOpen.focus();
	    wOpen.moveTo(0, 0);
	    wOpen.resizeTo(screen.availWidth, screen.availHeight);
	    
            window.open(url, windowName, "width=300,height=400,scrollbars=yes");         
        },	
    });
});